#define DEBUG
#include <cstdio>
#include <cmath>

using namespace std;

typedef long long ll;
const int maxsqrtn=1000000, mods=998244353;

int miu[maxsqrtn+1];

void getMiu(int n) {
	static int prime[maxsqrtn+1];
	static bool book[maxsqrtn+1];
	miu[1] = 1;
	for (int i=2; i<=n; i++) {
		if (!book[i]) {
			prime[++prime[0]] = i;
			miu[i] = -1;
		}
		for (int j=1; j<=prime[0] && i*prime[j]<=n; j++) {
			book[i*prime[j]] = true;
			if (i%prime[j]==0) {
				miu[i*prime[j]] = 0;
				break;
			} else {
				miu[i*prime[j]] = miu[i]*miu[prime[j]];
			}
		}
	}
}

int main() {
#ifdef DEBUG
	freopen("src.in", "r", stdin);
	freopen("src.out", "w", stdout);
#endif

	ll n;
	int sn;
	scanf("%lld", &n);
	sn = sqrt(n);
	getMiu(sn);

	ll ans=0;
	for (int i=1; i<=sn; i++) {
		ll temp=n/i/i;
		for (ll j=1, next; j<=temp; j=next+1) {
			next = temp/(temp/j);
			ans = (ans+mods+miu[i]*(temp/j)%mods*(next-j+1)%mods)%mods;
		}
	}
	printf("%lld", ans);

	fclose(stdin);
	fclose(stdout);
	return 0;
}
